//
//  LGSearchRecordCell.m
//  HeartDiseaseManage
//
//  Created by 1234 on 2023/3/30.
//

#import "LGSearchRecordCell.h"

@interface LGSearchRecordCell()

/**   */
@property (nonatomic , strong)UIImageView *iconView;
/**   */
@property (nonatomic , strong)UILabel *contentLabel;


@end

@implementation LGSearchRecordCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.contentView.backgroundColor = [UIColor colorWithString:@"#F9F9F9"];
        [self.contentView addSubview:self.iconView];
        [self.contentView addSubview:self.contentLabel];
        [self.contentView addSubview:self.deleteBtn];
        [self.iconView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView).offset(viewPix(17));
            make.centerY.equalTo(self.contentView);
            make.width.height.equalTo(@(viewPix(16)));
        }];
        [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.iconView.mas_right).offset(viewPix(5));
            make.centerY.equalTo(self.contentView);
            make.right.equalTo(self.deleteBtn.mas_left).offset(-viewPix(10));
        }];
        [self.deleteBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self.contentView).offset(-viewPix(6));
            make.centerY.equalTo(self.contentView);
            make.width.height.equalTo(@(viewPix(36)));
        }];
    }
    return  self;
}

-(void)setContent:(NSString *)content{
    _content = content;
    self.contentLabel.text = content;
}

-(UIImageView *)iconView{
    if(!_iconView){
        _iconView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"患者搜素-历史记录"]];
    }
    return _iconView;
}

-(UILabel *)contentLabel{
    if(!_contentLabel){
        _contentLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFont(16) textAlignment:NSTextAlignmentLeft lines:1];
    }
    return _contentLabel;
}

-(UIButton *)deleteBtn{
    if(!_deleteBtn){
        _deleteBtn = [UIButton buttonWithImage:@"患者搜素-删除记录" selectImage:@"患者搜素-删除记录"];
    }
    return _deleteBtn;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
